package com.example.monit.controller;

import com.example.monit.bean.PageSkipBehavior;
import com.example.monit.bean.ResponseRust;
import com.example.monit.service.PageSkipBehaviorService;
import com.example.monit.vo.PageSkipBehaviorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/behaviors")
public class PageSkipBehaviorController {
    @Autowired
    PageSkipBehaviorService pageSkipBehaviorService;


    /**
     * 页面跳转行为数据上传
     */
    @PostMapping("/pageskipbehaviors")
    public ResponseRust uploadPageSkipBehavior(@RequestBody List<PageSkipBehavior> pageSkipBehavior) throws IOException {
        return this.pageSkipBehaviorService.upLoadPageSkipBehavior(pageSkipBehavior);
    }

    /**
     * 页面跳转行为数据查询
     */
    @GetMapping("/pageskipbehaviors")
    public ResponseRust  getPageSkipBehavior(PageSkipBehaviorVo pageSkipBehaviorVo ) throws IOException {
        return this.pageSkipBehaviorService.queryPageSkipBehavior(pageSkipBehaviorVo);
    }

}
